
function init() {
    // Accordion
    $("#accordion").accordion({ 
        header: "h3",
        collapsible: "false",
        active: "false" 
    });

    $("#home, #conf_net, #conf_access, #conf_inst, #conf_stat").click(loadConf);
    $("#mon_net, #mon_system").click(loadMon);
}

function loadMon () {
    url = "graphs/" + this.id + ".html";
    loadContentDiv(url);
}

function loadConf () {
    url = this.id + ".html";
    loadContentDiv(url);
}

function loadContentDiv(url) {
    $.ajax({
        type: "GET",
        async: false,
        url: url,
        success: function(msg){
        $("#content").html(msg);
        }
    });
}

function loadHeader() {
    var html = "<div style='float: left; padding-top: 25px;'><img src=lab.png></div>";

    $("#header").html(html);
    $("#header").addClass("ui-widget-header");
}

function loadFooter() {
    var html = "<div style='float: left;'><img src=lab.png></div>";

    html = html + "<div style='float: left;'><span style='font-size: 20px'>Linux Appliance Box</span>";

    $("#header").html(html);
    $("#header").addClass("ui-widget-header");
}

function loadLeftPane(page) {
    var ids = Array("index", "doc", "apps", "ack", "feedback");
    var titles = Array("Home", "Documentation", "Appliances", "Acknowledgement", "Feedback");
    var html = "<div id='leftNav'>";

    for(i in ids) {
        if(ids[i] == page) {
            html = html + "<div id='" + ids[i] + "' class='active ui-state-active'>" + titles[i] + "</div>";
        }
        else {
            html = html + "<div id='" + ids[i] + "' class='default ui-state-default'><a href='" + ids[i] + ".html'>" + titles[i] + "</a></div>";
        }
    }

    html = html + "</div><br><h3>Recent Updates</h3><div id='recent_news' class='ui-state-highlight' style='height: 200px;'> </div>";

    $("#leftPane").html(html);

}
